package com.link2room.jetfire.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by sss on 2016/9/20.
 */
@Entity
@Table(name = "reservation_price", catalog = "")
@DynamicInsert
public class ReservationPrice extends BaseEntity{
    public enum ReservationPrice_{
        l2RNo,resDate,roomtype,rateType,amount,mcCode
    }
    /**
     * 联房订单号
     */
    private String l2RNo;
    /**
     * 日期
     */
    private Date resDate;
    /**
     * 房型
     */
    private String roomtype;
    /**
     * 费用类型 room房费，extra杂费
     */
    private String rateType;
    /**
     * 金额(基价)
     */
    private BigDecimal amountBase;
    /**
     * 金额(底价)
     */
    private BigDecimal amountCost;
    /**
     * 金额(卖价)
     */
    private BigDecimal amountSale;
    /**
     * 金额(PMS)
     */
    private BigDecimal amountPms;
    /**
     * 活动代码
     */
    private String mcCode;

    @Basic
    @Column(name = "l2r_no", nullable = true, length = 30)
    public String getL2RNo() {
        return l2RNo;
    }

    public void setL2RNo(String l2RNo) {
        this.l2RNo = l2RNo;
    }

    @Basic
    @Column(name = "res_date", nullable = false)
    public Date getResDate() {
        return resDate;
    }

    public void setResDate(Date resDate) {
        this.resDate = resDate;
    }

    @Basic
    @Column(name = "roomtype", nullable = true, length = 32)
    public String getRoomtype() {
        return roomtype;
    }

    public void setRoomtype(String roomtype) {
        this.roomtype = roomtype;
    }

    @Basic
    @Column(name = "rate_type", nullable = true, length = 30)
    public String getRateType() {
        return rateType;
    }

    public void setRateType(String rateType) {
        this.rateType = rateType;
    }

    @Basic
    @Column(name = "amount_cost", nullable = true, precision = 12,scale = 2)
    public BigDecimal getAmountCost() {
        return amountCost;
    }

    public void setAmountCost(BigDecimal amountCost) {
        this.amountCost = amountCost;
    }

    @Basic
    @Column(name = "amount_sale", nullable = true, precision = 12,scale = 2)
    public BigDecimal getAmountSale() {
        return amountSale;
    }

    public void setAmountSale(BigDecimal amountSale) {
        this.amountSale = amountSale;
    }

    @Basic
    @Column(name = "amount_pms", nullable = true, precision = 12,scale = 2)
    public BigDecimal getAmountPms() {
        return amountPms;
    }

    public void setAmountPms(BigDecimal amountPms) {
        this.amountPms = amountPms;
    }

    @Basic
    @Column(name = "mc_code", nullable = false, length = 32)
    public String getMcCode() {
        return mcCode;
    }

    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }

    @Basic
    @Column(name = "amount_base", nullable = true, precision = 12,scale = 2)
    public BigDecimal getAmountBase() {
        return amountBase;
    }

    public void setAmountBase(BigDecimal amountBase) {
        this.amountBase = amountBase;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ReservationPrice that = (ReservationPrice) o;

        if (l2RNo != null ? !l2RNo.equals(that.l2RNo) : that.l2RNo != null) return false;
        if (resDate != null ? !resDate.equals(that.resDate) : that.resDate != null) return false;
        if (roomtype != null ? !roomtype.equals(that.roomtype) : that.roomtype != null) return false;
        if (rateType != null ? !rateType.equals(that.rateType) : that.rateType != null) return false;
        if (amountCost != null ? !amountCost.equals(that.amountCost) : that.amountCost != null) return false;
        if (amountSale != null ? !amountSale.equals(that.amountSale) : that.amountSale != null) return false;
        if (mcCode != null ? !mcCode.equals(that.mcCode) : that.mcCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = l2RNo != null ? l2RNo.hashCode() : 0;
        result = 31 * result + (resDate != null ? resDate.hashCode() : 0);
        result = 31 * result + (roomtype != null ? roomtype.hashCode() : 0);
        result = 31 * result + (rateType != null ? rateType.hashCode() : 0);
        result = 31 * result + (amountCost != null ? amountCost.hashCode() : 0);
        result = 31 * result + (amountSale != null ? amountSale.hashCode() : 0);
        result = 31 * result + (mcCode != null ? mcCode.hashCode() : 0);
        return result;
    }
}
